package cn.iocoder.yudao.module.biz.dal.mysql.emergencyReservePlainDept;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.emergencyReservePlainDept.BizEmergencyReservePlainDeptDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.emergencyReservePlainDept.vo.*;

/**
 * 应急部门 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BizEmergencyReservePlainDeptMapper extends BaseMapperX<BizEmergencyReservePlainDeptDO> {

    default PageResult<BizEmergencyReservePlainDeptDO> selectPage(BizEmergencyReservePlainDeptPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizEmergencyReservePlainDeptDO>()
                .likeIfPresent(BizEmergencyReservePlainDeptDO::getName, reqVO.getName())
                .betweenIfPresent(BizEmergencyReservePlainDeptDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(BizEmergencyReservePlainDeptDO::getId));
    }

    default List<BizEmergencyReservePlainDeptDO> selectList(BizEmergencyReservePlainDeptExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BizEmergencyReservePlainDeptDO>()
                .likeIfPresent(BizEmergencyReservePlainDeptDO::getName, reqVO.getName())
                .betweenIfPresent(BizEmergencyReservePlainDeptDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(BizEmergencyReservePlainDeptDO::getId));
    }

}
